﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace WebApplication2
{
    public partial class TimKiem : System.Web.UI.Page
    {
        string strCon = @"Data Source=THEGUNNER-PC\SQLEXPRESS;Initial Catalog=QLThuVien;Integrated Security=True";
        SqlConnection conn = null;
        SqlCommand cmd = null;
        protected void Page_Load(object sender, EventArgs e)
        {
            conn = new SqlConnection(strCon);
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            conn.Open();

            String strcmd = "SELECT * FROM Sach WHERE DonGia BETWEEN'" + txt1.Text + "'AND'" + txt2.Text + "'";
            cmd = new SqlCommand(strcmd, conn);
            cmd.ExecuteNonQuery();
            GridView1.DataBind();


            conn.Close();
        }

      
    }
}